#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int StrtoInt(string s){
	return (s[0]-48)*1000+(s[1]-48)*100+(s[2]-48)*10+s[3]-48; 
} 
void InttoStr(char *s,int x){
	int i,cnt,x1=x;
	for( cnt=0; x1; cnt++ ) x1/=10;
	for( i=3; cnt>0; cnt-- ){
		s[i]=x%10+48; i--;
		x/=10;
	}
	for( ; i>-1; i-- ) s[i]=0+48;
}

int main(){
	string s;
	int t;
	cin>>t;
	InttoStr(s,t);
	cout<<s<<endl;
	//sort(s,s+4);
	cout<<s<<endl;
	return 0;
}
